import Layout from '@/Layout/index.vue';
// 静态路由
export const routes = [
  {
    path: '/login',
    name: 'Login',
    meta: { title: '登录' },
    component: () => import('@/views/login/index.vue')
  },
  {
    path: '/:pathMatch(.*)*',
    name: 'NotFound',
    component: () => import('@/views/exception/index.vue')
  }
];
// 动态路由
export const syncRoutes = [
  {
    path: '/',
    name: 'Dashboard',
    redirect: '/dashboard/workplace',
    component: Layout,
    meta: { title: 'Dashboard' },
    children: [
      {
        path: '/dashboard/workplace',
        name: 'DashboardWorkplace',
        meta: { title: '工作台' },
        component: () => import('@/views/dashboard/workplace/index.vue')
      },
      {
        path: '/dashboard/analysis',
        name: 'DashboardAnalysis',
        meta: { title: '分析页' },
        component: () => import('@/views/dashboard/analysis/index.vue')
      },
      {
        path: '/dashboard/monitor',
        name: 'DashboardMonitor',
        meta: { title: '监控页' },
        component: () => import('@/views/dashboard/monitor/index.vue')
      }
    ]
  },
  {
    path: '/system',
    name: 'System',
    redirect: '/system/user',
    component: Layout,
    meta: { title: '系统管理' },
    children: [
      {
        path: '/system/user',
        name: 'SystemUser',
        meta: { title: '用户管理' },
        component: () => import('@/views/system/user/index.vue')
      },
      {
        path: '/system/role',
        name: 'SystemRole',
        meta: { title: '角色管理' },
        component: () => import('@/views/system/role/index.vue')
      },
      {
        path: '/system/menu',
        name: 'SystemMenu',
        meta: { title: '菜单管理' },
        component: () => import('@/views/system/menu/index.vue')
      },
      {
        path: '/system/organization',
        name: 'SystemOrganization',
        meta: { title: '机构管理' },
        component: () => import('@/views/system/organization/index.vue')
      },
      {
        path: '/system/dictionary',
        name: 'SystemDictionary',
        meta: { title: '字典管理' },
        component: () => import('@/views/system/dictionary/index.vue')
      },
      {
        path: '/system/file',
        name: 'SystemFile',
        meta: { title: '文件管理' },
        component: () => import('@/views/system/file/index.vue')
      },
      {
        path: '/system/login-record',
        name: 'SystemLoginRecord',
        meta: { title: '登录日志' },
        component: () => import('@/views/system/login-record/index.vue')
      },
      {
        path: '/system/operation-record',
        name: 'SystemOperationRecord',
        meta: { title: '操作日志' },
        component: () => import('@/views/system/operation-record/index.vue')
      }
    ]
  },
  {
    path: '/user',
    name: 'User',
    redirect: '/user/profile',
    component: Layout,
    meta: { title: '个人中心' },
    children: [
      {
        path: '/user/profile',
        name: 'UserProfile',
        meta: { title: '我的资料' },
        component: () => import('@/views/user/profile/index.vue')
      },
      {
        path: '/user/message',
        name: 'UserMessage',
        meta: { title: '我的消息' },
        component: () => import('@/views/user/message/index.vue')
      }
    ]
  },
  {
    path: '/expansion',
    name: 'Expansion',
    redirect: '/expansion/file-upload',
    component: Layout,
    meta: { title: '扩展组件' },
    children: [
      {
        path: '/expansion/file-upload',
        name: 'FileUpload',
        meta: { title: '文件上传' },
        component: () => import('@/views/expansion/file-upload/index.vue')
      }
    ]
  }
];
